﻿@model IEnumerable<SteelX.SMS.Model.Expense>

<table>
        <tr>
            <th>Actions</th>
            <th>Category</th>
            <th>
                Transaction
            </th>
            <th>
                Date
            </th>
            <th>
                Amount
            </th>
        </tr>

    @foreach (var item in Model) {
    
        <tr>
            <td>
                @Html.ActionLink("Edit", "Edit",new { id = item.ExpenseId })
                @Ajax.ActionLink("Delete", "Delete", new { id = item.ExpenseId }, new AjaxOptions { Confirm = "Delete Expense?", HttpMethod = "Post", UpdateTargetId = "divExpenseList" })
            </td>
			 <td>
                @item.Category.Name
            </td>
            <td>
                @item.Transaction
            </td>
            <td>
                @String.Format("{0:d}", item.Date)
            </td>
            <td>
                @String.Format("{0:F}", item.Amount)
            </td>
        </tr>
    
    }

    </table>
	<p>
        @Html.ActionLink("Create New Expense", "Create") | @Html.ActionLink("Create New Category", "Create","Category")
    </p>